﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Linq;

namespace CourseSelectionSystem
{
    public partial class AddCourse : Form
    {
        private readonly CourseSelectionSystemServices service = new CourseSelectionSystemServices();
        public AddCourse()
        {
            InitializeComponent();
        }

        private void AddCourse_Load(object sender, EventArgs e)
        {

        }

        private void buttonCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void buttonOK_Click(object sender, EventArgs e)
        {
            CreateModelc modelc = new CreateModelc()
            {
                ID = textID.Text,
                Name = textName.Text,
                Teacher = textTeacher.Text,
                Credit = textCredit.Text,
            };
            service.Createc(modelc);
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
    }
}
